<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <%@include file="../../common/Include_input_head.jsp" %>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <script type="text/javascript" src="${basePath}/resources/js/common/json2.js"></script>

    <script type="text/javascript">
        $(function () {
            var s = '${save}';
            if (s != null && s != '') {
                $("#menuFrame", parent.document).attr("src", $("#menuFrame", parent.document).attr("src"));
                alert("保存成功！");
            }
        });

        function doRemoveLbxx() {
            if (window.confirm("删除后无法恢复，是否确认删除？")) {
                $.ajax({type: "POST", url: '${basePath}/s/uc/lb/d/${lbxx.wid}', success: function () {
                    parent.window.location.reload();
                }})
            }
        }
    </script>
</head>

<body style="text-align:center;">
<div class="box1" panelWidth="99%">
    <form:form action="${basePath}/s/uc/lb/e" name="ysform" theme="simple" commandName="lbxx" htmlEscape="true"
               method="POST">
        <form:hidden path="wid"/>
        <form:hidden path="upid"/>
        <div class="box1" panelWidth="99%">
            <fieldset>
                <legend>列表信息</legend>
                <table class="tableStyle" transMode="true" footer="normal">
                    <c:if test='${lbxx.wid != "0"}'>
                        <tr>
                            <td align="right" width="16%" nowrap="nowrap">上级名称：</td>
                            <td align="left"> ${lbxx.upname} </td>
                        </tr>
                    </c:if>
                    <tr>
                        <td align="right" width="16%" nowrap="nowrap">名称：</td>
                        <td align="left">
                            <form:input path="name" cssStyle="width: 300px;"/> <label style="color:red">*</label>
                        </td>
                    </tr>
                    <tr>
                        <td align="right" valign="top">备注：</td>
                        <td align="left">
                            <form:textarea path="des" cssStyle="width: 296px;"/>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">排序值：</td>
                        <td align="left"><form:input path="orderno" cssStyle="width: 300px;" maxlength="5" onkeydown="NumberText(event)"/>
                            <label style="color:red">*</label><font color="#999999">说明：同一层次中数值小的往前排</font></td>
                    </tr>
                    <tr>
                        <td align="right">状态：</td>
                        <td align="left">
                            <form:radiobutton path="state" value="1" label="启用"/>
                            <form:radiobutton path="state" value="0" label="禁用"/>
                            <label style="color:red">*</label></td>
                    </tr>
                    <tr>
                        <td align="right">类型：</td>
                        <td align="left">
                            <form:radiobutton path="lx" value="1" label="一般"/>
                            <form:radiobutton path="lx" value="2" label="新闻"/>
                            <form:radiobutton path="lx" value="3" label="消息"/>
                            <form:radiobutton path="lx" value="5" label="流程"/>
                            <label style="color:red">*</label></td>
                    </tr>
                    <c:if test='${lbxx.wid != "0" && lbxx.wid != "1" && lbxx.wid != "2" && lbxx.wid != "3"  && lbxx.wid != "4"}'>
                        <tr>
                            <td align="right">数据源：</td>
                            <td align="left">
                                <form:select path="db"
                                             cssStyle="width: 300px;border-color: #cccccc;height: 24px;color: #336699;"
                                             cssClass="default" items="${listCode}" itemLabel="caption" itemValue="id"/>
                            </td>
                        </tr>
                    </c:if>
                    <tr>
                        <td align="right">访问地址：</td>
                        <td align="left"><form:input path="url" cssStyle="width: 300px;"/></td>
                    </tr>
                    <tr>
                        <td align="right">“更多”访问地址：</td>
                        <td align="left"><form:input path="moreurl" cssStyle="width: 300px;"/></td>
                    </tr>
                    <c:if test='${lbxx.lx == "3" || lbxx.lx == "5"}'>
                        <tr>
                            <td align="right" valign="top">SQL：</td>
                            <td align="left">
                                <form:textarea path="sql" cssStyle="width: 496px;height:250px;"/>
                            </td>
                        </tr>
                    </c:if>
                </table>
            </fieldset>
        </div>
    </form:form>
    <div class="padding_top10">
        <table class="tableStyle" transMode="true">
            <tr>
                <td colspan="4">
                    <c:if test='${lbxx.wid != "0"}'>
                        <input type="button" id="ysSaveButton" value=" 保 存 " onclick="document.forms[0].submit()"/>&nbsp;
                    </c:if>
                    <c:if test='${lbxx.lx == "3"  && lbxx.wid != "4"}'>
                        <input type="button" id="ysSaveButton" value=" 删 除 " onclick="doRemoveLbxx()"/>&nbsp;
                    </c:if>
                    <c:if test="${lbxx.add}">
                        <input type="button" id="ysInsertButton" value=" 新增子菜单 "
                               onclick="window.location.href='${basePath}/s/uc/lb/e?upid=${lbxx.wid}'"/>
                    </c:if>
                </td>
            </tr>
        </table>
    </div>
</div>
</body>
</html>
